package cn.wx.scholar;

import java.io.File;
import cn.wx.common.utils.JSONUtils;
import cn.wx.common.utils.UUIDGenerator;
import cn.wx.scholar.core.entity.TxtBook;

public class TxtJsonTset {

	private final static String picPath = "D:\\my_book_pic\\";
	
	public static void main(String[] args) {
		
		String json = "{\r\n" + 
				"	\"lang\": \"Turkish\",\r\n" + 
				"	\"asin\": \"6056534057\",\r\n" + 
				"	\"_pd\": {\r\n" + 
				"		\"Publisher\": \"Cagaloglu Publishing House (April 25, 2016)\",\r\n" + 
				"		\"Paperback\": \"100 pages\",\r\n" + 
				"		\"Shipping Weight\": \"2.9 ounces (\",\r\n" + 
				"		\"Language\": \"Turkish\",\r\n" + 
				"		\"Product Dimensions\": \"4 x 0.2 x 7 inches\",\r\n" + 
				"		\"Average Customer Review\": \"Be the first to review this item\",\r\n" + 
				"		\"ISBN-10\": \"6056534057\",\r\n" + 
				"		\"ISBN-13\": \"978-6056534058\"\r\n" + 
				"	},\r\n" + 
				"	\"ae\": [\"Fatih Oncu\", \"(Editor), \", \"Cagaloglu Global\", \"(Producer)\"],\r\n" + 
				"	\"name\": \"ONLINE KITAP PAZARLAMA: Sizi sadece Turkiye degil, #DunyaOkusun (Turkish Edition)\",\r\n" + 
				"	\"href\": \"https://www.amazon.com/ONLINE-KITAP-PAZARLAMA-Turkiye-DunyaOkusun/dp/6056534057/ref=sr_1_685/142-4588127-9704341?s=books&ie=UTF8&qid=1532486311&sr=1-685\",\r\n" + 
				"	\"bi\": \" \\\"<p>&ldquo;Stephen King yada &nbsp;Malcolm Gladwell olamdÄ±ÄÄ±nÄ±z s&uuml;rece -- yayÄ±neviniz kuvvetli ihtimal sizin kitabÄ±nÄ±zla ilgili tanÄ±tÄ±m yapmayacak. &nbsp;Siz kitabÄ±nÄ±zÄ±n tanÄ±tÄ±mÄ±nÄ± yapmazsanÄ±z hi&ccedil; kimse yapmayacak.&rdquo; diyor, Tony Levelle, Digital Video Secrets kitabÄ±nÄ±n yazarÄ±.<br /> TanÄ±tÄ±m ve pazarlama bir eserin daha fazla okuyucuya ulaÅmasÄ±nda &ouml;nemli bir etken. &nbsp;Bu &ccedil;alÄ±Åma, online imkanlarÄ± kullanÄ±larak bir eserin uluslararasÄ± alanda pazarlanma y&ouml;ntemlerini sunmaktadÄ±r.<br /> &nbsp;</p>\\\"\",\r\n" + 
				"	\"pb\": \"Cagaloglu Publishing House (April 25, 2016)\",\r\n" + 
				"	\"_ae\": [\"/Fatih-Oncu/e/B075F7YYYY/ref=dp_byline_cont_book_1\", \"/s/ref=dp_byline_sr_book_2?ie=UTF8&text=Cagaloglu+Global&search-alias=books&field-author=Cagaloglu+Global&sort=relevancerank\"],\r\n" + 
				"	\"tag\": \"Books => Computers & Technology => Graphics & Design => Electronic Documents\",\r\n" + 
				"	\"pd\": \"4 x 0.2 x 7 inches\",\r\n" + 
				"	\"fi\": \"\",\r\n" + 
				"	\"isbn\": \"6056534057\",\r\n" + 
				"	\"pn\": \"100\"\r\n" + 
				"}";
		
		
		TxtBook td = JSONUtils.p(json, TxtBook.class);
		
		
		String fileName = picPath + UUIDGenerator.getUUID() + "\\" + 2 + "\\" + UUIDGenerator.getUUID() + ".jpg";
    	
    	File file=new File(fileName);
    	File fileParent = file.getParentFile();  
    	if(!fileParent.exists()){  
    	    fileParent.mkdirs();  
    	}  
		System.out.println("11" +td);
		
	}

}
